home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / wschesb1.zip / SRC / GLOBALS.C < prev    next >
C/C++ Source or Header  |  1994-03-15  |  5KB  |  151 lines

  1. /*
  2.   C source for Winsock Chess
  3.   
  4.   Revision 1994-03-15
  5.   Modified by Donald Munro for use as a 2 player chess game over a 
  6.   WINSOCK layer on a TCP (or other WinSock supporting) network.
  7.   Source code and make files for MS Visual C/C++ V1.00/1.50.
  8.   February/March 1994
  9.   All GNU copyright and distribution conditions as described below and in the
  10.   file COPYING also apply to WinSock Chess.
  11.   This module is adapted from GNU Chess.
  12.  
  13.   C source for GNU CHESS
  14.  
  15.   Revision: 1990-09-30
  16.  
  17.   Modified by Daryl Baker for use in MS WINDOWS environment
  18.  
  19.   Copyright (C) 1986, 1987, 1988, 1989, 1990 Free Software Foundation, Inc.
  20.   Copyright (c) 1988, 1989, 1990  John Stanback
  21.  
  22.   This file is part of CHESS.
  23.  
  24.   CHESS is distributed in the hope that it will be useful, but WITHOUT ANY
  25.   WARRANTY.  No author or distributor accepts responsibility to anyone for
  26.   the consequences of using it or for whether it serves any particular
  27.   purpose or works at all, unless he says so in writing.  Refer to the CHESS
  28.   General Public License for full details.
  29.  
  30.   Everyone is granted permission to copy, modify and redistribute CHESS, but
  31.   only under the conditions described in the CHESS General Public License.
  32.   A copy of this license is supposed to have been given to you along with
  33.   CHESS so you can know your rights and responsibilities.  It should be in a
  34.   file named COPYING.  Among other things, the copyright notice and this
  35.   notice must be preserved on all copies.
  36. */
  37.  
  38. #define NOATOM 
  39. #define NOCLIPBOARD
  40. #define NOCREATESTRUCT
  41. #define NOFONT
  42. #define NOREGION
  43. #define NOSOUND
  44. #define NOWH
  45. #define NOWINOFFSETS
  46. #define NOCOMM
  47. #define NOKANJI
  48.  
  49. #include <windows.h>
  50. #include <stdio.h>
  51.  
  52. #include "gnuchess.h"
  53.  
  54. struct BookEntry far  *Book;
  55.  
  56. #if ttblsz
  57. unsigned long hashkey, hashbd;
  58. /*struct hashval hashcode[2][7][64];*/
  59. /*static struct huge ttable[2][ttblsz]; */
  60. struct hashval far *hashcode;
  61. struct hashentry far *ttable;
  62. #endif /* ttblsz */
  63.  
  64. FILE *hashfile;
  65. /*struct leaf Tree[2000], *root;*/
  66. struct leaf far *Tree, far *root;
  67.  
  68. short TrPnt[maxdepth];
  69. short PieceList[2][16], PawnCnt[2][8];
  70. #define wking PieceList[white][0]
  71. #define bking PieceList[black][0]
  72. #define EnemyKing PieceList[c2][0]
  73. short castld[2], Mvboard[64];
  74. short svalue[64];
  75. struct flags flag;
  76. short opponent, computer, Awindow, Bwindow, dither, INCscore;
  77. long ResponseTime, ExtraTime, Level, et, et0, time0, ft;
  78. long NodeCnt, ETnodes, EvalNodes, HashCnt, FHashCnt, HashCol;
  79. short player, xwndw, rehash;
  80.  
  81. /*struct GameRec GameList[512];*/
  82. struct GameRec far *GameList;
  83.  
  84. short Sdepth, GameCnt, Game50, MaxSearchDepth;
  85. short epsquare, contempt;
  86. /*struct BookEntry *Book;*/
  87. struct TimeControlRec TimeControl;
  88. short TCflag, TCmoves, TCminutes, OperatorTime;
  89. unsigned short hint, PrVar[maxdepth];
  90. short Pindex[64];
  91. short PieceCnt[2];
  92. short c1, c2, *atk1, *atk2, *PC1, *PC2, atak[2][64];
  93. short mtl[2], pmtl[2], emtl[2], hung[2];
  94. short FROMsquare, TOsquare, Zscore, zwndw;
  95. short HasKnight[2], HasBishop[2], HasRook[2], HasQueen[2];
  96. short ChkFlag[maxdepth], CptrFlag[maxdepth], PawnThreat[maxdepth];
  97. short Pscore[maxdepth], Tscore[maxdepth];
  98. unsigned short killr0[maxdepth], killr1[maxdepth];
  99. unsigned short killr2[maxdepth], killr3[maxdepth];
  100. unsigned short PV, Swag0, Swag1, Swag2, Swag3, Swag4;
  101. /*unsigned char history[8192];*/
  102. unsigned char far *history;
  103.  
  104. short rpthash[2][256];
  105. short Mwpawn[64], Mbpawn[64], Mknight[2][64], Mbishop[2][64];
  106. short Mking[2][64], Kfield[2][64];
  107. short KNIGHTPOST, KNIGHTSTRONG, BISHOPSTRONG, KATAK;
  108. short PEDRNK2B, PWEAKH, PADVNCM, PADVNCI, PAWNSHIELD, PDOUBLED, PBLOK;
  109. short RHOPN, RHOPNX, KHOPN, KHOPNX, KSFTY;
  110. short ATAKD, HUNGP, HUNGX, KCASTLD, KMOVD, XRAY, PINVAL;
  111. short stage, stage2, Developed[2];
  112. short PawnBonus, BishopBonus, RookBonus;
  113.  
  114. /*short distdata[64][64], taxidata[64][64];*/
  115. short far *distdata, far *taxidata;
  116.  
  117. short board[64], color[64];
  118. /*unsigned char nextpos[8][64][64]; */
  119. /*unsigned char nextdir[8][64][64]; */
  120. unsigned char far *nextpos;
  121. unsigned char far *nextdir;
  122.  
  123.  
  124. const short otherside[3] = {1, 0, 2};
  125.  
  126. #if ttblsz
  127. #if HASHFILE
  128. /*
  129.   In a networked enviroment gnuchess might be compiled on different
  130.   hosts with different random number generators, that is not acceptable
  131.   if they are going to share the same transposition table.
  132. */
  133. static unsigned long int next = 1;
  134.  
  135. unsigned int urand (void)
  136. {
  137.   next *= 1103515245;
  138.   next += 12345;
  139.   return ((unsigned int) (next >> 16) & 0xFFFF);
  140. }
  141.  
  142. void srand (unsigned int seed)
  143. {
  144.   next = seed;
  145. }
  146. #endif /*HASHFILE*/
  147. #endif /*ttblsz*/
  148.  
  149. HWND hComputerMove;
  150. HWND hStats;
  151.